#include<bits/stdc++.h>
using namespace std;
random_device seed;
mt19937 mt(seed());
int main(){
    int n,m,q;
    n = m = q = 1000;
    m = 500;
    cout<<n<<' '<<m<<' '<<q<<'\n';
    for(int i = 1;i<=n;i++){
        for(int j = 1; j<= 2;j++){
            char c = mt()%26 + 'a';
            cout<<c;
        }
        cout<<'\n';
    }
    for(int i = 1;i<=m;i++){
        for(int j = 1; j<= 20;j++){
            char c = mt()%26 + 'a';
            cout<<c;
        }
        cout<<'\n';
    }
    for(int i = 1;i<=q;i++){
        int x,y;
        x = mt()%m + 1;
        y = mt()%m + 1;
        while(y == x){
            y = mt()%m + 1;
        }
        cout<<x<<' '<<y<<'\n';
    }
}